package com.atguigu05.map.ex2;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Scanner;
import java.util.Set;

public class test {
    public static void main(String[] args) {
        citymap c=new citymap();
        Set provinceset=  c.model.keySet();
        for (Object o:provinceset
             ) {
            System.out.print(o+" ");
        }
        System.out.println();
        System.out.println("选择你所在的省份：");
        String provience;
        Scanner scanner=new Scanner(System.in);
        provience=scanner.nextLine();
        String[] cities;
        while(true){
            if(c.model.containsKey(provience)){
                cities=(String[]) c.model.get(provience);
                for (int i = 0; i < cities.length; i++) {
                    System.out.print(cities[i]+" ");
                }
                break;
            }else{
                System.out.println("请重新输入：");
            }
        }
        System.out.println();
        System.out.println("请选择城市：");
        String city;
        city=scanner.nextLine();
        for (int i = 0; i < cities.length; i++) {
            if(cities[i].equals(city)){
                System.out.println("信息登记完毕");
            }
        }

//        Iterator iterator=provinceset.iterator();
//        while(iterator.hasNext()){
//            if (iterator.next().equals(c.model.keySet())){
//
//            }
//        }


    }
}
